﻿//***********************************************************************
// Assembly         : phpmk
// Author           : sy
// Created          : 06-09-2010
//
// Last Modified By : sy
// Last Modified On : 06-14-2010
// Description      : 
//
// Copyright        : (c) Another-D-Mention Software. All rights reserved.
//***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using phpmk.ADM.Out;
using System.Windows.Forms;

namespace phpmk.ADM.Commands.Help {

    class HelpCommand : ICommand {

        private StringDictionary parameters;
        
        public void PrintUsageInfo(Dictionary<String, ICommand> commands)
        {
            Console.WriteLine("\nUsage Info: phpmk -command [/arguments] [--plugin [/options]]\n");
            Console.WriteLine("Commands");
            Output.GetInstance().StartTable(2);
            foreach (KeyValuePair<string, ICommand> command in commands) {
                Output.GetInstance().AddRow(new string[] { " " + command.Key, command.Value.Info() });
            }
            Output.GetInstance().EndTable();
        }

        public void Execute(StringDictionary parameters) {
            
        }

        public void Help()
        {
            Output output = Output.GetInstance();
            output.Info("Shows detailed informations about the specified command");
            output.Write("\nUsage Info: phpmk -help command");
            output.Write("            phpmk -h command");
            output.Write("            phpmk /? command");
        }

        public string Info()
        {
            return "Returns detailed info about the specified command";
        }

    }
}
